25.0410334, 121.5246697
struct PinLocation: Identifiable {
let id = UUID()
var name: String
var image: String
var coordinate: CLLocationCoordinate2D
var rank: Int
init(name: String, image: String, coordinate: CLLocationCoordinate2D, rank: Int) {
self.name = name
self.image = image
self.coordinate = coordinate
self.rank = rank
}
init() {
self.name = "秘密釣點 - 五股聖母宮"
self.image = "default"
self.coordinate = CLLocationCoordinate2D(latitude:25.1125, longitude:121.4582)
self.rank = 5 // 1: Bad ~ 5: Good
}
}
let coordinate = spot.coordinate!.split(separator:[",", " "])
let x = (coordinate[0] as NSString).doubleValue
let y = (coordinate[1] as NSString).doubleValue
var imgUrl: String = spot.imageUrl ?? "Empty"